package org.zj.webview.app;

import org.noear.solon.Solon;
import org.noear.solon.annotation.Import;
import org.noear.solon.annotation.SolonMain;
import org.zj.webview.WebViewApi;
import org.zj.webview.WebViewInstallUtils;

import java.io.IOException;

@Import(scanPackages = "org.zj.webview.app")
@SolonMain
public class Main {
    public static void main(String[] args) throws IOException {
        // 安装webview dll
        WebViewInstallUtils.install();
        boolean dev = Boolean.getBoolean("app.dev");
        if (!dev) {
            System.setProperty("server.host", "127.0.0.1");
            System.setProperty("server.port", String.valueOf(WebViewApi.getRandomUnusedLocalPort()));
        }
        Solon.start(Main.class, args);
    }
}